package com.ruoyi.pos.domain.dto.cashier.response;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;
import java.util.List;

/**
 * 收银员登录响应DTO
 * 
 * @author ruoyi
 * @date 2025-01-30
 */
@Data
@ApiModel(description = "收银员登录响应")
public class CashierLoginResponse {

    @ApiModelProperty(value = "收银员ID")
    private Long cashierId;

    @ApiModelProperty(value = "收银员编码")
    private String cashierCode;

    @ApiModelProperty(value = "收银员姓名")
    private String cashierName;

    @ApiModelProperty(value = "登录状态")
    private String loginStatus;

    @ApiModelProperty(value = "登录时间")
    private Date loginTime;

    @ApiModelProperty(value = "登录IP")
    private String loginIp;

    @ApiModelProperty(value = "设备ID")
    private Long deviceId;

    @ApiModelProperty(value = "设备名称")
    private String deviceName;

    @ApiModelProperty(value = "可操作的设备列表")
    private List<DeviceInfo> availableDevices;

    @ApiModelProperty(value = "可操作的柜组列表")
    private List<GroupInfo> availableGroups;

    @ApiModelProperty(value = "访问令牌")
    private String accessToken;

    @ApiModelProperty(value = "令牌过期时间")
    private Date tokenExpireTime;
    
    @ApiModelProperty(value = "操作是否成功")
    private Boolean success;
    
    @ApiModelProperty(value = "返回消息")
    private String message;

    /**
     * 设备信息
     */
    @Data
    @ApiModel(description = "设备信息")
    public static class DeviceInfo {
        @ApiModelProperty(value = "设备ID")
        private Long deviceId;

        @ApiModelProperty(value = "设备名称")
        private String deviceName;

        @ApiModelProperty(value = "设备编码")
        private String deviceCode;

        @ApiModelProperty(value = "是否默认设备")
        private Boolean isDefault;
    }

    /**
     * 柜组信息
     */
    @Data
    @ApiModel(description = "柜组信息")
    public static class GroupInfo {
        @ApiModelProperty(value = "柜组ID")
        private Long groupId;

        @ApiModelProperty(value = "柜组名称")
        private String groupName;

        @ApiModelProperty(value = "柜组编码")
        private String groupCode;

        @ApiModelProperty(value = "权限级别")
        private String permissionLevel;
    }
}
